package com.everflourish.yeah100.entity.marking;

import java.io.Serializable;

/**
 * 题型
 * 
 * @author pf
 * @date 2014-11-20
 */
public class Topic implements Serializable {
	private static final long serialVersionUID = 1L;

	/** 大题名称 */
	private String topicName;
	/** 题型类型：单选题1，多选题2，主观题3 */
	private Integer topicType;
	/** 起始题号 */
	private Integer topicBegin;
	/** 结束题号 */
	private Integer topicEnd;
	/** 每题分值 */
	private Float topicPoint;
	/** 缺选分值 */
	private Float topicPartPoint;

	public String getTopicName() {
		return topicName;
	}

	public void setTopicName(String topicName) {
		this.topicName = topicName;
	}

	public Integer getTopicType() {
		return topicType;
	}

	public void setTopicType(Integer topicType) {
		this.topicType = topicType;
	}

	public Integer getTopicBegin() {
		return topicBegin;
	}

	public void setTopicBegin(Integer topicBegin) {
		this.topicBegin = topicBegin;
	}

	public Integer getTopicEnd() {
		return topicEnd;
	}

	public void setTopicEnd(Integer topicEnd) {
		this.topicEnd = topicEnd;
	}

	public Float getTopicPoint() {
		return topicPoint;
	}

	public void setTopicPoint(Float topicPoint) {
		this.topicPoint = topicPoint;
	}

	public Float getTopicPartPoint() {
		return topicPartPoint;
	}

	public void setTopicPartPoint(Float topicPartPoint) {
		this.topicPartPoint = topicPartPoint;
	}

	public String getTopicTypeText() {
		String topicTypeText = "";
		/** 题型类型：单选题1，多选题2，主观题3 */
		if (getTopicType() == 1) {
			topicTypeText = "单选题";
		} else if (getTopicType() == 2) {
			topicTypeText = "多选题";
		} else if (getTopicType() == 3) {
			topicTypeText = "主观题";
		}
		return topicTypeText;
	}

	public Integer getTopicType(String topicTypeText) {
		Integer topicType = null;
		/** 题型类型：单选题1，多选题2，主观题3 */
		if (topicTypeText.equals("单选题")) {
			topicType = 1;
		} else if (topicTypeText.equals("多选题")) {
			topicType = 2;
		} else if (topicTypeText.equals("主观题")) {
			topicType = 3;
		}
		return topicType;
	}
}
